﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Text;

namespace Data.Abstract
{
        public abstract class BaseCollection<S> : List<S>
            where S : BaseSimple, new()
        {
            internal DataTable _CacheData;

            internal void LoadByData(DataTable Data)
            {
                _CacheData = Data;
                foreach (DataRow dr in Data.Rows)
                {
                    LoadByData(dr);
                }
            }
            internal void LoadByData(DataRow dr)
            {
                S s = new S();
                s.LoadByDataRow(dr);
                this.Add(s);
            }
        } 
}
